/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package acscoreserver;

import java.io.IOException;

/**
 *
 * @author Ricardo
 */
public class Main {

    /**
     * @param args the command line arguments
     */




    public static void main(String[] args) {
        String cmd="";
        String dir="";
        String sendtoque="";

        cmd=args[0];
        dir=args[1];

        if(args.length>2){
            sendtoque=args[2];
        }




        

        System.out.println("\nMain.java:42:Going to start \n");


        ACServerProcess acSP = new ACServerProcess(cmd, dir);



        ACScore acs = new ACScore();



        //while (true){


            try {
                    //ACScore acs= new ACScore("server_autogenerated.sh","/opt/AssaultCube");
                //cmd, dir,
                    acs.startACScore(acSP,sendtoque);

            } catch (IOException ex) {
                System.out.println("\n\nMain.java:61:IOException: "+ex.getMessage());
                


            } catch (Exception ex) {
                //ex.printStackTrace();
                System.out.println("\n\nMain.java:65:Exception: "+ex.getMessage());

                
            }
            System.out.println("\n\nMain.java:78:process Destroyed");
        //}


       



    }

}
